﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>代理管理</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/page.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.js"></script> 
<script type="text/javascript" src="__PUBLIC__/admin/js/xc.admin.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<nav class="breadcrumb mb10">
  <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 会员管理 <span class="c-gray en">&gt;</span> 代理列表
  <a class="btn btn-success radius r mr-20 btn-shua" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>

<div class="pd-20">
	<a class="btn btn-primary radius" onclick="layer_show('添加代理','__MODULE__/User/dailiAddEdit','600','')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加代理</a>
	<div class="mt-10">
		<table id="xctable" class="table table-border table-bordered table-hover table-bg table-sort">
			<thead>
			<tr class="text-c">
				<th width="20">编号</th>
				<th width="60" id="dl_uid" onClick="tab_sort(this)"><div class="">用户ID</div></th>
				<th width="80" id="dl_gid" onClick="tab_sort(this)"><div class="">代理等级</div></th>
				<th width="80" id="dl_name" onClick="tab_sort(this)"><div class="">用户姓名</div></th>
				<th width="80" id="dl_area" onClick="tab_sort(this)"><div class="">代理地区</div></th>
				<th width="60">操作</th>
			</tr>
			</thead>
			<volist name="list" id="vo" >
				<tr class="text-c">
					<td>{$i}</td>
					<td>{$vo.dl_uid}</td>
					<td><if condition="$vo['dl_gid'] eq 1">省级<elseif condition="$vo['dl_gid'] eq 2"/>市级</if>代理</td>
					<td>{$vo.dl_name}</a></td>
					<td>{$vo.area}</a></td>
					<td>
						<a href="javascript:;"style="text-decoration: none;" onclick="layer_show('修改代理','__MODULE__/User/dailiAddEdit/id/{$vo.dl_id}','600','')">编辑</a>
						<a style="text-decoration:none" href="javascript:;" onclick="del(this,'{$vo.dl_id}')"title="删除"><i class="Hui-iconfont">&#xe609;</i></a></td>
				</tr>
			</volist>
		</table>
	</div>
</div>
<script type="text/javascript">
	/*删除*/
	function del(obj, id) {
		layer.confirm('确认要删除吗？', function(index) {
			$.ajax({
				type : 'post',
				url : '__MODULE__/User/deaDaili',
				data : {id:id},
				dataType : 'json',
				success : function(res){
					if(res.status == 1){
						$(obj).parents("tr").remove();
						layer.msg('已删除!', {icon: 1,time: 1000});
					}else{
						layer.msg(res.msg, {icon: 2});
					}
				},
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					layer.alert('网络失败，请刷新页面后重试',{icon:2});
				}
			})
		});
	}
</script>
</body>
</html>